package com.sdstc.modules.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Objects;

/**
 * @author ：wk
 * @date ：Created in 2022/10/21 14:52
 */
@Data
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class AdjustMentVo implements Serializable {



    // 调整前列表
    private  OrgAdjustVo adjustFront;


    // 调整后列表
    private  OrgAdjustVo adjustAfter;


    // 记录列表
    private HashMap<Integer, List<Object>> record;


    // 方案编号
    private String planCode;

    // 方案创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;


    // 方案名称
    private String planName;


    // 方案备注
    private String remark;

    // 创建依据
    private String createBasis;


    // 生成依据
    private String effectBasis;





    public static class Organization{
        // 内设
        private List<OrganizationDetail> internal;

        // 派出
        private List<OrganizationDetail> dispatch;

        // 下设
        private List<OrganizationDetail> under;

        // 事业
        private List<OrganizationDetail> cause;
    }





    @Data
    public static class OrganizationDetail{
        private int plan;

        private int existing;

        private int state;

        public OrganizationDetail(Integer plan,Integer existing){
            this.plan = plan;
            this.existing = existing;
            this.state = existing - plan;
        }

        public static OrganizationDetail buildInstance(Integer plan,Integer existing){
            OrganizationDetail organization = new OrganizationDetail( plan, existing);
            return organization;
        }
    }


}
